const myURL1 = new URL('http://nodejs.cn/api/url.html?aa=11&bb=22#url_url_host');
console.log(myURL1);
/**
{
	href: 'http://nodejs.cn/api/url.html#url_url_host',
	origin: 'http://nodejs.cn',
	protocol: 'http:',
	username: '',
	password: '',
	host: 'nodejs.cn',
	hostname: 'nodejs.cn',
	port: '',
	pathname: '/api/url.html',
	search: '?aa=11&bb=22',
	searchParams: URLSearchParams {},
	hash: '#url_url_host'
}
*/

const myURL = new URL('http://nodejs.cn/api/url.html?aa=11&bb=22');
console.log(myURL.searchParams.get('aa'));//11
myURL.searchParams.append('cc', '33');
console.log(myURL.href);//http://nodejs.cn/api/url.html?aa=11&bb=22&cc=33

myURL.searchParams.delete('bb');
myURL.searchParams.set('aa', '111');
console.log(myURL.href);//http://nodejs.cn/api/url.html?aa=111&cc=33